package com.link.thread;

/**
 * Created by wangyg
 * on 2017/2/28 19:09
 */
public class TestThread {
/*	public static void main(String[] args) {
		Thread a = new

				Thread() {
					public void run() {
						for (int i = 1; i < 100; i++) {
							System.out.println("这是第" + i + "个输出");
							try {
								sleep(10);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
						}
					}
				};
		a.start();
	}*/

/*	public static void main(String[] args) {
		Runnable runnable = new Runnable() {
			public void run() {
				for (int i = 0; i < 10; i++) {
					System.out.println("this is No."+i);
				}
			}
		};
		Thread thread=new Thread(runnable);
		thread.start();
	}*/

	public static void main(String[] args) {
		Thread thread = new Thread() {
			public void run() {
				for (int i = 0; i < 10; i++) {
					System.out.println("this is No." + i);
				}
			}
		};
		thread.start();
	}
}
